package com.example.string.unit1;

/**
 * @author ASUS
 */
public class StringCompareEmp {
    public static void main(String[] args){
        String str = "Hello World";
        String anotherString = "hello world";
        Object objStr = str;
        System.out.println( str.compareTo(anotherString) );
        //忽略大小写
        System.out.println( str.compareToIgnoreCase(anotherString) );
        System.out.println( str.compareTo(objStr.toString()));
    }
}
